﻿<%@ Page Language="c#" CodeFile="~/Default.aspx.cs" Inherits="TallComponents.Web.WebForm1" %>

<%@ Register TagPrefix="tc" Namespace="TallComponents.Web" Assembly="App_Code" %>
<%@ Register TagPrefix="tc" Namespace="TallComponents.Web.Pdf" Assembly="TallComponents.Web.PdfViewer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head runat="server">
   <title>Upload & View Demo - PDFWebViewer.NET</title>
   <style type="text/css">
      body
      {
         font-family: Verdana, Arial, Helvetica, _sans;
         font-size: 12px;
      }
      img
      {
         border: 0px;
      }
      .thumb
      {
         display: block;
         margin: 0px;
         padding: 0px;
      }
      .thumb img
      {
         border: solid 1px #999999;
         margin: 3px;
      }
      .thumb:hover img
      {
         border: solid 2px #66ff33;
         margin: 2px;
      }
      .active img
      {
         border: solid 2px black;
         margin: 2px;
      }
      a:active
      {
         outline: 0 none black;
      }
      .searchResult
      {
         border: solid 1px red;
      }
      
      .bookmark
      {
         font-size: x-small;
      }
      .bookmark:hover
      {
         color: Red;
      }
      .activeBookmark
      {
         font-size: small;
         color: Red;
      }
   </style>
   <link rel="Stylesheet" type="text/css" href="modal.css" />
</head>
<body>
   <form id="Form1" method="post" runat="server" enctype="multipart/form-data">
   <asp:ScriptManager ID="ScriptManager1" runat="server" />
   <script type="text/javascript">
      Sys.Application.add_load(function () {
         $find('Toolbar').add_buttonClick(function (sender, args) {
            if (args.command == 'open') {
               var modal = $find('Modal1').show(450, 300);
            } else if (args.command == 'close') {
               window.location.href = window.location.href;
            }
         });
      });
   </script>
   <tc:ModalDialog runat="server" ID="Modal1" Title="Upload a file">
      <p>
         <input type="file" size="50" name="pdf" />
      </p>
      <asp:Button runat="server" Text="Upload" ID="uploadPdf" OnClick="uploadPdf_Click" />
      <input type="button" value="Cancel" onclick="$find('Modal1').hide(); return false;" />
   </tc:ModalDialog>
   
      <table style="table-layout: fixed; width: 90%; height: 80%; min-height: 500px;position:absolute; border:1px solid #aaaaaa">
         <tr style="height:20px">
            <td style="width: auto; height: 20px;border:1px solid #aaaaaa">
               <tc:PdfViewerToolbar ID="Toolbar" runat="server" class="toolbar" PdfViewerControlId="pdfViewer"
                  Width="100%" ShowFileButtons="true" />
            </td>
         <tr>
            <td>
               <tc:PdfViewer ID="pdfViewer" runat="server" Width="100%" Height="100%" ZoomMode="FitToWidth" style="border:1px solid #aaaaaa"
                  ServiceUrl="pageasimage.ashx" SearchServiceUrl="search.ashx" SearchResultCssClass="searchResult" />
            </td>
         </tr>
      </table>
   
   </form>
</body>
</html>
